home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / OTHERCST / HARVEST_ / EXAMPLES / SAMPLE1.C < prev   
C/C++ Source or Header  |  1991-10-09  |  472b  |  33 lines

  1.  /* Very simple program , with floating point */
  2.  
  3. /*
  4.  
  5. This program is simple, but it demonstrates the following :
  6.     1. integer and floating point arithmetic
  7.     2. global data initialization
  8.     3. inclusion of standard header files
  9.     4. call of a Toolbox trap
  10.  
  11. */
  12.  
  13. #include <osutils.h>
  14. #include <types.h>
  15.  
  16. double x = 100;
  17. double ss;
  18. char y;
  19.  
  20. int main()
  21. {
  22.   int p;
  23.   int j;
  24.    ss = 3.14;
  25.   x = x * 3.14;
  26.   j = x / ss;
  27.   j /= 25;
  28.   y=j;
  29.   while (y--)
  30.     SysBeep(1);
  31.   return j;
  32. }
  33.